package sv.gob.mh.dgii.jasper.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import sv.gob.mh.dgii.jasper.service.ReportingService;

@Controller
public class ReportingServiceController {

    @Autowired
    private ReportingService reportingService;

    @RequestMapping(value = "/report/report")
    public void report(HttpServletRequest request, HttpServletResponse response) {
        reportingService.executeReport(request, response);
    }

    @RequestMapping(value = "/report/report/{reportName}")
    public void report_con_nombre(HttpServletRequest request,
            HttpServletResponse response,
            @PathVariable(value = "reportName") String reportName) {

        reportingService.executeReport(request, response);
    }
}
